Skip to content

Fix undeterministic tests in desktop UI#496

Merged
bedaHovorka merged 2 commits intocopilot/goal-7-simulation-speed-controlfrom
copilot/fix-undeterministic-tests
May 7, 2026
Merged

Fix undeterministic tests in desktop UI#496
bedaHovorka merged 2 commits intocopilot/goal-7-simulation-speed-controlfrom
copilot/fix-undeterministic-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

  • Rebase branch onto copilot/goal-7-simulation-speed-control
  • Deep analysis of issue FIX : undeterministic tests #495: root causes identified
    1. Missing startedLatch.await() in nullMainProcessNoOpcf9759b removed it, claiming "runner is assigned synchronously". True, but without the await, blockSim.countDown() can race with the sim thread starting. On a busy CI runner (maxParallelForks = availableProcessors()), the sim thread can be delayed several seconds. The 10 s blockSim.await() then expires without release → test times out.
    2. Shared latches companion-object IdentityHashMap — mutable static state shared across all test instances (MockK state + IdentityHashMap entries accumulate with no cleanup); code smell removed.
    3. No @AfterEach cleanup — a test failure before releaseSim() left the sim daemon thread blocked for 10 s on blockSim.await().
  • Fix: restore startedLatch.await(30s) in nullMainProcessNoOp with generous CI timeout
  • Fix: replace companion-object latches IdentityHashMap with per-test lateinit instance fields
  • Fix: add @BeforeEach/@AfterEach to initialize and release latches, plus call unmockkAll()
  • Fix: increase blockSim.await() 10 s → 30 s and all @Timeout 10 s → 30 s
  • Local verification: 563 tests, 562 pass, 1 skipped, 0 failures

Copilot AI and others added 2 commits May 7, 2026 14:43
… nullMainProcessNoOp (issue #495)

Agent-Logs-Url: https://github.com/bedaHovorka/interlockSim/sessions/57c03945-0a5c-4b57-a850-c1a29f81f146

Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
@bedaHovorka bedaHovorka force-pushed the copilot/fix-undeterministic-tests branch from f1e7806 to f648bc4 Compare May 7, 2026 12:44
@bedaHovorka bedaHovorka changed the title [WIP] Fix undeterministic tests in desktop UI Fix undeterministic tests in desktop UI May 7, 2026
@bedaHovorka bedaHovorka requested a review from Copilot May 7, 2026 12:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes nondeterministic desktop-ui tests around SimulationController speed propagation by removing shared latch state and making thread-start synchronization explicit, addressing CI scheduling delays (Issue #495).

Changes:

  • Replaced companion-object latch side-table with per-test CountDownLatch instance fields initialized in @BeforeEach.
  • Added @AfterEach cleanup that always releases the simulation-blocking latch (and clears MockK state) to prevent lingering daemon threads across tests.
  • Increased all relevant awaits and @Timeout values from 10s to 30s and restored startedLatch.await() in nullMainProcessNoOp.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@bedaHovorka bedaHovorka merged commit 81dd75c into copilot/goal-7-simulation-speed-control May 7, 2026
14 checks passed
@bedaHovorka bedaHovorka deleted the copilot/fix-undeterministic-tests branch May 7, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FIX : undeterministic tests

3 participants